 <script th:inline="javascript">
/*<![CDATA[*/

    function del(event,element){
        event.preventDefault();
          bootbox.confirm("您确定删除吗?", function(result) {
        if(result){
            var _id = $(element).attr("href").split("_")[0];
            var _page=$(element).attr("href").split("_")[1];
            var _viewState = $(element).attr("href").split('_')[2];
            var _postCardPromotionId = $("#hidden_postCardPromotionId").val();

            BOSS.remoteCall('promotion/postcard/deletePostCard',$('#postcard_grid'),{id:_id,postCardPromotionId:_postCardPromotionId,page:_page,viewState:_viewState});
            }
        }); 
    }
    
/*]]>*/
</script>
<input id="hidden_postCardPromotionId" type="hidden" th:value="${postCardPromotionId}"/>
<table layout:fragment="postcard_table" class="table table-striped table-bordered  table-advance table-hover" id="postcard_grid">
    <thead>
        <tr>
            <th>编号</th>
            <th>包邮卡卡号</th>
            <th>包邮卡类别</th>
            <th>使用时限</th>
            <th>使用次限</th>
            <th>已使用次数</th>
            <th>用户</th>
            <th>操作</th>
        </tr>
    </thead>    
    <tbody>
        <tr class="odd gradeX" th:each="data : ${postCardPage}">
            <td th:text="${data.id}">
                编号
            </td>
            <td th:text="${data.code}">
                 包邮卡卡号
            </td>
            <td th:text="${data.postCardPromotion.name}">
                包邮卡类别
            </td>
            <td th:text="${data.postCardPromotion.monthLimitCount}">
                使用时限
            </td>
            <td th:text="${data.postCardPromotion.timesLimitCount}">
                使用次限
            </td>
            <td th:text="${data.usedNum}">
                已使用次数
            </td>
            <td th:text="${data.user}  ? ${data.user.name} :'未绑定用户'">
                用户
            </td>
            <td>
                <a th:attr="id=${'link_delete_'+dataStat.index}" th:href="${data.id}+'_'+${postCardPage.number}+'_'+${viewState}" onclick="del(event,this)">移除</a>
            </td>         
        </tr>
     </tbody>
</table>


